#include <stdio.h>
#include <stdlib.h>
#include <errno.h>

char *csver = "0.8-9";
static char *helpline = "\
Usage:Cpuset [OPTIONS]\n\
      Cpuset <[-n NAME] [-u CPU]> -e <COMMAND>\n\
--help or -h        show this message\n\
--name or -n <name> give a 'name' to operate\n\
--pid  or -p <pid>  give a 'pid' to operate\n\
--cpu  or -u <cpulist> give cpulist to create a cpuset\n\
--create or -c      create a cpuset, with <name> and <cpulist>\n\
       for example: cpuset -c -n examp -u 0-7\n\
                    will create a cpuset named \"examp\" and cpus \"0-7\",\n\
--rename or -r <newname> rename a cpuset,old name read from <name>\n\
       for example:     cpuset -n oldname -r newname\n\
--setcpu or -s      used with --name and --cpulist, change a cpuset's cpu with <cpulist>.\n\
       for example: cpuset -s -n cs -u 8-15\n\
                    twill change cpuset named \"cs\"  's cpulist to 8-15\n\
--list or -l        when use this with no <pid> and <name> gived,show all\n\
                    cpusets created in system. \n\
                    if gives <pid>,show which cpuset this PID resides in,and\n\
                    give the cpu number this process running in, and the allowed\n\
                    CPUs this can run at. like follows:\n\
                    #cpuset -l -p <PID>\n\
                    cs_name    1      0-7\n\
                    shows it's at cpuset cs_name, now running at CPU#1, and it's \n\
                    allowed CPUs is: 0-7\n\
                    if gives <name>,show all the PIDs in this cpuset\n\
--force or -f       when delete a cpuset, force or not\n\
--del or -d         delete a cpuset. if <name> gived, delete this cpuset\n\
                    if <pid>  gived, delete the cpuset this PID resides in.\n\
                    when delete a cpuset ,all the process in the old cpuset\n\
                    are unbind\n\
--bind or -b        bind the <pid> to a cpuset named <name>. if didn't give\n\
                    the <name>, unbind the process\n\
--unbind            unbind the process <pid> gived. the same as -b -p <pid>.\n\
--migrate or -m <cpu> migrate <pid> to run at <cpu>. if <cpu> doesn't include\n\
                    in the cpuset'cpulist which <pid> resides in, create a \n\
                    new cpuset named as \"pid\",and include\n\
                    { <cpu>,{original cpuset's cpu} }\n\
--unbindall         unbind all the process running in -n <name>\n\
--kill or -k        kill all the process running in cpuset <name>, \n\
                    if gives -f, delete <name>\n";
char *lbhelpline = "\
Usage:\n\
     lbconfig -l [-p PID] \n\
     lbconfig -L\n\
     lbconfig -d [-p PID] [-n NAME]\n\
     lbconfig --reset \n\
     lbconfig -v [--version]        \n\
     \n\
    -L              reload /etc/relate file \n\
    --list or -l    list relations of all\n\
    --del or -d     with \n\
        --pid or -p: del the specialfied task's relation;\n\
                    with \n\
        --name or -n:del all the task's relation named NAME\n\
    --reset         reset all related tasks to none relationship\n\
    --version or -v : show the version of lbconfig\n\
    --help or -h    : show this message.\n";
void show_lbhelp(void)
{
		fprintf(stdout, "%s\n",lbhelpline);
		exit(errno);
}


void show_help()
{
		fprintf(stdout, "%s\n",helpline);
		exit(errno);
}
